<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
	<th:block th:include="include :: header('库存报表')" />
</head>
<body class="gray-bg">
    
     <div class="container-div" onmousemove="parent.updateTimeOut()">
		<div class="row">

			<div class="col-sm-12 search-collapse">
				<form id="formId">
					<div class="select-list">
						<ul>
							<li>
								物料编码：<input type="text" name="itemCode"/>
							</li>
							<li>
								批次：<input type="text" name="batch"/>
							</li>
							<li>
								子库存组织：
								<select name="subInventoryId">
									<option value="-1"></option>
									<option value="1">待检</option>
									<option value="2">基板一厂板材库</option>
									<option value="3">基板一厂板材过期库</option>
									<option value="4">基板一厂板材延期库</option>
									<option value="5">基板一厂不合格库</option>
									<option value="6">基板一厂责任待确认材料库</option>
									<option value="7">基板一厂预测备料库</option>
								</select>
							</li>
							<li>
								类型：
								<select name="type">
									<option value="2"></option>
									<option value="1">差异库存</option>
								</select>
							</li>
							<li>
								<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
								<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
							</li>
						</ul>
					</div>
				</form>
			</div>
			
	        <div class="btn-group-sm" id="toolbar" role="group">
<!--				<a class="btn btn-success" onclick="addBill()" shiro:hasPermission="in:billInMaster:add">-->
<!--					<i class="fa fa-plus"></i> 添加-->
<!--				</a>-->
<!--&lt;!&ndash;				<a class="btn btn-primary btn-edit disabled" onclick="$.operate.edit()" shiro:hasPermission="in:billInMaster:edit">&ndash;&gt;-->
<!--&lt;!&ndash;					<i class="fa fa-edit"></i> 修改&ndash;&gt;-->
<!--&lt;!&ndash;				</a>&ndash;&gt;-->
<!--				<a class="btn btn-danger btn-del btn-del disabled" onclick="$.operate.removeAll()" shiro:hasPermission="in:billInMaster:remove">-->
<!--					<i class="fa fa-remove"></i> 删除-->
<!--				</a>-->
				<!--<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="in:boxItem:export">
						<i class="fa fa-download"></i> 导出
				</a>-->
			</div>
			<div class="col-sm-12 select-table table-striped">
				<table id="bootstrap-table" data-mobile-responsive="true" style="white-space:nowrap"></table>
			</div>
		</div>
	</div>


    <div th:include="include :: footer"></div>
    <script th:inline="javascript">
        var editFlag = [[${@permission.hasPermi('in:boxItem:edit')}]];
        var removeFlag = [[${@permission.hasPermi('in:boxItem:remove')}]];
        var prefix = ctx + "in/boxItem";


        function addBill(){

			var _url = prefix+"/add";

			$.modal.openFull("新增",_url);
		}

        $(function() {
            var options = {
                url: prefix + "/selectList",
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
				exportUrl: prefix + "/export",
				detailUrl:prefix + "/detail",
                modalName: "库存报表",
		        showExport: false,
                columns: [
                	/*{
		            	checkbox: true
		        	},*/
					{
						field : 'subInventoryCode',
						title : '子库存号',
						sortable: true
					},
					{
						field : 'itemCode',
						title : '物料编码',
						sortable: true
					},
					{
						field : 'itemName',
						title : '物料描述',
						visible: true
					},
					{
						field : 'batch',
						title : '批次',
						sortable: true
					},
					{
						field: 'exp',
						title: '过期日期',
						sortable: true
					},
					{
						field : 'quantity',
						title : '数量（张）',
						sortable: true
					},
					{
						field: 'ebsQuantity',
						title: 'EBS数量',
						visible: true
					},
					{
						field: 'differenceQuantity',
						title: '差异数量',
						visible: true,
						formatter: function (value, row, index) {
							var actions = [];
							if (value !== 0) {
								actions.push("<span style='display: inline-block;line-height: 30px;padding: 0 10px;border: 1px solid #ff0e15;color: #070707;background-color: #ff0e15;'><!--待检-->"+row.differenceQuantity+"</span>");
							}
							else{
								actions.push("<span style='display: inline-block;line-height: 30px;padding: 0 10px;border: 1px solid #d9ecff;color: #434647;background-color: #F7F8FC;'><!--待检-->"+row.differenceQuantity+"</span>");
							}
							return actions.join('');
						}
					},


					{
						field: 'subInventoryId',
						title: '子库',
						sortable: true,
						formatter: function (value, row, index) {
							var actions = [];
							if (value === 1) {
								actions.push("<span style='display: inline-block;line-height: 30px;padding: 0 10px;border: 1px solid #d9ecff;color: #434647;background-color: #F7F8FC;'><!--待检-->"+row.subInventoryName+"</span>");
							}
							if (value === 2) {
								actions.push("<span style='display: inline-block;line-height: 30px;padding: 0 10px;border: 1px solid #d9ecff;color: #434647;background-color: #34ff3e;'><!--基板一厂板材库-->"+row.subInventoryName+"</span>");
							}
							if (value === 3) {
								actions.push("<span style='display: inline-block;line-height: 30px;padding: 0 10px;border: 1px solid #d9ecff;color: #434647;background-color: #ff30ed;'><!--基板一厂板材过期库-->"+row.subInventoryName+"</span>");
							}
							if (value === 4) {
								actions.push("" +
										"<span style='display: inline-block;line-height: 30px;padding: 0 10px;border: 1px solid #d9ecff;color: #434647;background-color: #FFAD7E;'><!--基板一厂板材延期库-->"+row.subInventoryName+"</span>");
							}
							if (value === 5) {
								actions.push("<span style='display: inline-block;line-height: 30px;padding: 0 10px;border: 1px solid #d9ecff;color: #434647;background-color: #fdff2d;'><!--基板一厂不合格库-->"+row.subInventoryName+"</span>");
							}
							if (value === 6) {
								actions.push("<span style='display: inline-block;line-height: 30px;padding: 0 10px;border: 1px solid #d9ecff;color: #434647;background-color: #ff0e15;'><!--基板一厂责任待确认材料库-->"+row.subInventoryName+"</span>");
							}
							if (value === 7) {
								actions.push("<span style='display: inline-block;line-height: 30px;padding: 0 10px;border: 1px solid #d9ecff;color: #434647;background-color: #598dff;'><!--基板一厂预测备料库-->"+row.subInventoryName+"</span>");
							}
							return actions.join('');
						}
					},
		        ]
            };
            $.table.init(options);
        });
    </script>
</body>
</html>